package org.travelfusion.xmlclient.module;

import static com.google.inject.matcher.Matchers.annotatedWith;
import static com.google.inject.matcher.Matchers.subclassesOf;

import org.travelfusion.xmlclient.impl.transport.LoggingTransportInterceptor;
import org.travelfusion.xmlclient.transport.TfXTransport;
import org.travelfusion.xmlclient.transport.TfXTransport.Send;

import com.google.inject.AbstractModule;

public class LoggingTransportInterceptorModule extends AbstractModule {

  @Override
  protected void configure() {
    LoggingTransportInterceptor interceptor = new LoggingTransportInterceptor();
    binder().requestInjection(interceptor);
    bindInterceptor(subclassesOf(TfXTransport.class), annotatedWith(Send.class), interceptor);
  }
}
